﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Person/Person.Master" AutoEventWireup="true"
    CodeBehind="OrderList.aspx.cs" Inherits="ZF.BLL.Person.OrderList" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
 <div class="location   mt10_  ">
        您现在的位置：<a href="/person/index.aspx">会员中心</a> >> <a href="<%=this.Request.Url %>">我的订单</a>
    </div>
 <style>
 .f1{ color:#3366CC;}
 .f2{ color:#f00;}
 .f3{ color:#eee;}
 .f4{ color:#339933;}
 .fs1{color:#999900;}
 .fs2{color:#0f0;}
 .fs3{color:#0ff;}
 .fs4{color:#f0f;}
 </style>
 <div >&nbsp;</div>
    <!--自定义条件 开始-->
    <div class="tabHeadMenu ">
        <a href="<%=this.ListPage %>?Status=0" class='<%=(Status==0 )?"action":"" %>'>全部订单</a> 
        <a href="<%=this.ListPage %>?Status=1" class='<%=(Status==1)?"action":"" %>'>等待支付</a>
        <a href="<%=this.ListPage %>?Status=2" class='<%=(Status==2)?"action":"" %>'>已发货</a>
        <a href="<%=this.ListPage %>?Status=3" class='<%=(Status==3)?"action":"" %>'>已完成</a>
        <a href="<%=this.ListPage %>?Status=4" class='<%=(Status==4)?"action":"" %>'>已作废</a>
 
    </div>
    
    <!--自定义条件 结束-->
    <!--列表 开始-->
    <div class="tabContainer">
        <zf:GridView ID="gvList" runat="server" OnSorting="gvListSorting" OnPageIndexChanging="gvListPageChanging">
            <Columns>
                 <zf:TemplateField IsKeyField="true" DefaultSortField="true" DefaultSortDirection="Descending" SortExpression="Order.OrderId">
                    <ItemTemplate>
                        <asp:Label runat="server" ID="KeyLabel" Text='<%# Eval("Order.OrderId")%>'></asp:Label>
                    </ItemTemplate>
                </zf:TemplateField>
                <zf:TemplateField IsCheckField="true">
                </zf:TemplateField>
                <zf:TemplateField IsSerialNoField="true" Visible="false">
                </zf:TemplateField> 
              <zf:TemplateField HeaderText="描述"  ItemStyle-Width="250px"    >
                    <ItemTemplate>
                        <table class="tal_ w100_" style="text-align: left;">
                            <tr>
                                <td rowspan="5" style="width: 40px; height: 40px;"><a href='/shop/info.aspx?id=<%# Eval("Merc.MerchandiseId")%>' target="_blank">
                                    <img src="/photo/shop/<%# Eval("Merc.FirstPhoto")%>" style="width: 60px; height: 60px; border:1px solid #eee" />
                                    </a>
                                </td>
                            </tr>
                            <tr>
                                <td style='word-break: break-all; width: 200px; vertical-align: top'>
                                    <a href='/shop/info.aspx?id=<%# Eval("Merc.MerchandiseId")%>' target="_blank"><span
                                        style1="color:#E4532B">
                                        <%--商品名称:--%></span> <span class="f1">
                                            <%#  ((string)Eval("Merc.Name")).MaxLength(30)%></span> </a>
                                </td>
                                
                            </tr>
                             <tr>
                                <td style='word-break: break-all; width: 200px; vertical-align: top'>
                                  订单号：<%# Eval("Order.OrderNo")%> 
                                  
                                </td>
                                
                            </tr>
                        </table>
                         <span class="fl_">下单时间：<%# Eval("Order.AddTime")%></span>
                    </ItemTemplate>
                </zf:TemplateField>
                <zf:TemplateField HeaderText="价格(元)*数量=总价(元)+积分</br>">
                    <ItemTemplate>
                        <div class=''>
                            <%#  Eval("Order.OPrice")%>元*<%#  Eval("Order.Quantity")%>=<%# (decimal)Eval("Order.DCPrice")%>元+<%# (int)Eval("Order.Integral")%>积分
                            <br />
                            <%--<img src="/image/ze.gif" class="<%#  ((decimal)Eval("Order.Discount")) == 10 ? "dn_" : ""%>" />
                            <img src="/image/dj.gif" class="<%#  ((int)Eval("Order.Integral")) == 0 ? "dn_" : ""%>" />--%>
                        </div>
                    </ItemTemplate>
                </zf:TemplateField>
                
                
          
                <zf:TemplateField HeaderText="运送方式">
                    <ItemTemplate>
                        <div class=''>
                            <%# GetFreightType((int)Eval("Order.FreightType"))%>
                        </div>
                    </ItemTemplate>
                </zf:TemplateField>
                 <zf:TemplateField HeaderText="支付方式">
                    <ItemTemplate>
                        <div class=''>
                            <%#Eval("Order.PayTypeName")%>
                        </div>
                    </ItemTemplate>
                </zf:TemplateField>
                <zf:TemplateField HeaderText="状态">
                    <ItemTemplate>
                        <div class=''>
                            <p class="<%#(bool)Eval("Order.IsPayed") ? "" : "fs1"%>">
                                <%#(bool)Eval("Order.IsPayed")  ? "已支付" : "未支付"%>
                            </p>
                             <p class="<%#(bool)Eval("Order.IsSend") ? "" : "fs2"%>">
                                <%#(bool)Eval("Order.IsSend")  ? "已发货" : "未发货"%>
                            </p>
                             <p class="fs4">
                                <%#Eval("Order.StatusName")%>
                            </p>
                        </div>
                    </ItemTemplate>
                </zf:TemplateField>
          
                
                <zf:TemplateField HeaderText="修改后价格">
                    <ItemTemplate>
                        <div>
                            <span class='f2'><%#  Eval("Order.LastPrice")%></span>
                              <span class=" <%#(bool)Eval("Order.IsPayed")  ? "dn_" : ""%>">
                            
                            </span><br />
                             <span class="zx_">(包含运费:<%#   Eval("Order.FreightPrice")%>)</span>
                        </div>
                    </ItemTemplate>
                </zf:TemplateField>
                <zf:TemplateField HeaderText="操作">
                    <ItemTemplate>
                        <table>
                            <tr>
                                <td>
                                    <a href='orderinfo.aspx?ot=Edit&id=<%# Eval("Order.OrderId")%>'>详细</a>
                                </td>
                                <td class="<%#((int)Eval("Order.PayType")) == (int)PayType.ToPay || (bool)Eval("Order.IsPayed")? "dn_" : ""%>">
                                   |<a href="/shop/pay.aspx?oid=<%# Eval("Order.OrderId")%>&mid=<%# Eval("Merc.MerchandiseId")%>"
                                                  target="_blank">支付</a>
                                </td>
                            
                                <%--<td class="<%#((int)Eval("Order.Status")) == (int)OrderStatus.处理中30 ? "" : "dn_"%>">
                                    <zf:LinkButton ID="LinkButton3" runat="server" OnClick="Rec" CommandArgument='<%#Eval("Order.OrderId") %>'>完成</zf:LinkButton>|
                                </td>
                                <td class="<%#((int)Eval("Order.Status")) == (int)OrderStatus.下单10 ? "" : "dn_"%>">
                                    <zf:LinkButton ID="LinkButton2" runat="server" OnClick="Affirm" CommandArgument='<%#Eval("Order.OrderId") %>'>确认</zf:LinkButton>|
                                </td>
                                <td class="<%#((int)Eval("Order.Status")) != (int)OrderStatus.订单已完成40 ? "" : "dn_"%>">
                                    <p class="<%#((int)Eval("Order.Status")) != (int)OrderStatus.作废50 ? "" : "dn_"%>">
                                        <zf:LinkButton ID="LinkButton4" runat="server" OnClick="Invalid" CommandArgument='<%#Eval("Order.OrderId") %>'
                                            OnClientClick="return confirm('是否将此订单作废');">作废</zf:LinkButton>
                                    </p>
                                    <p class="<%# this.Status==4 && ((int)Eval("Order.Status")) == (int)OrderStatus.作废50 ? "" : "dn_"%>">
                                        <zf:DropDownList runat="server" ID="ddlStatus" class="ddlStatus">
                                            <asp:ListItem Text="请选择还原状态" Value=""></asp:ListItem>
                                            <asp:ListItem Text="订单待确认" Value="10"></asp:ListItem>
                                            <asp:ListItem Text="订单已确认" Value="20"></asp:ListItem>
                                            <asp:ListItem Text="正在处理订单" Value="30"></asp:ListItem>
                                            <asp:ListItem Text="订单已完成" Value="40"></asp:ListItem>
                                            <asp:ListItem Text="订单作废" Value="50"></asp:ListItem>
                                        </zf:DropDownList>
                                        <zf:LinkButton ID="LinkButton5" runat="server" OnClick="Reduction" CommandArgument='<%#Eval("Order.OrderId") %>'
                                            class="lbReduction">还原</zf:LinkButton>|
                                    </p>
                                </td>--%>
                              
                                <td class="<%# this.Status==2?"":"dn_"%>">
                                     | <zf:LinkButton ID="LinkButton1" runat="server" OnClick="RecSubmit" CommandArgument='<%#Eval("Order.OrderId") %>'
                                        OnClientClick="return confirm('是否执行该操作');">确认收货</zf:LinkButton>
                                </td> 
                            </tr>
                        </table>
                    </ItemTemplate>
                </zf:TemplateField>
            </Columns>
        </zf:GridView>
        
        <script>

            $(function() {
                $(".lbReduction").click(function() {
                    if ($(this.parentNode).find(".ddlStatus")[0].value == "") {
                        alert("请选择要还原的状态"); return false;
                    }
                    return confirm('是否将此订单还原');
                });
            });
        </script>
        
    </div>
    <!--列表 结束-->
    <div class="mt5_ fc_">
    </div>
    <!--自定义按钮 开始-->
    <div class="btnContainer mt10_ dn_">
        <span class="fl_ mr10_">
            <input type="checkbox" class="checkAll" bind=".tab" />选中本页显示的所有记录</span>
     <%--   <zf:LinkButton ID="LinkButton1" runat="server" OnClick="Delete" CommandArgument='select'
            OnClientClick="return confirm('是否确定要删除选中记录');">删除选中的记录</zf:LinkButton>--%>
            
       <%-- <a href="<%=this.ManagePage %>?ot=AddNew">添加<%=CTitle%></a>
        
        <zf:LinkButton ID="LinkButton2" runat="server" OnClick="Oper" CommandArgument='SellUp'
            OnClientClick="return confirm('是否确定要执行该操作');">选中商品上架</zf:LinkButton>
  <zf:LinkButton ID="LinkButton3" runat="server" OnClick="Oper" CommandArgument='SellDown'
            OnClientClick="return confirm('是否确定要执行该操作');">选中商品下架</zf:LinkButton>
   <zf:LinkButton ID="LinkButton4" runat="server" OnClick="Oper" CommandArgument='CancelDiscount'
            OnClientClick="return confirm('是否确定要执行该操作');">选中商品取消折扣</zf:LinkButton>
   <zf:LinkButton ID="LinkButton5" runat="server" OnClick="Oper" CommandArgument='IsRecommend'
            OnClientClick="return confirm('是否确定要执行该操作');">取消或设置为推荐</zf:LinkButton>--%>
    </div>
    <!--自定义按钮 结束-->
    <div class="fc_ mt10_">
    </div>
    <!--搜索 开始-->
    <%--<div class="searchContainer">
        <table>
            <tr>
                <td class="l">
                    搜索选项:
                </td>
                <td class="m">
                    <div class="c">
                        <span class="t">物业名称:</span><span class="c">
                            <zf:TextBox runat="server" class="stxt" ID="tbTitle"></zf:TextBox></span>
                        <span class="t">物业类型:</span><span class="c">
                            <zf:DropDownList runat="server" ID="ddlHouseType" class="stxt" AppendDataBoundItems="true">
                                <asp:ListItem Value="-1" Text="未选择"></asp:ListItem>
                            </zf:DropDownList>
                        </span><span class="t">&nbsp;&nbsp;发布时间(小于):</span><span class="c">
                            <zf:TextBox runat="server" class="dttxt" ID="tbEndTime1" onfocus="calendar();"></zf:TextBox></span>
                        <br />
                        <span class="t">客户编号:</span><span class="c">
                            <zf:TextBox runat="server" class="stxt" ID="tbHouseNo"></zf:TextBox></span>
                        <span class="t">房源状态:</span><span class="c">
                            <zf:DropDownList runat="server" ID="ddlHouseStatus" class="stxt" AppendDataBoundItems="true">
                                <asp:ListItem Value="-1" Text="未选择"></asp:ListItem>
                                 <asp:ListItem Value="1" Text="发布中"></asp:ListItem>
                                  <asp:ListItem Value="2" Text="停止发布"></asp:ListItem>
                                   <asp:ListItem Value="3" Text="已交易"></asp:ListItem>
                            </zf:DropDownList>
                        </span><span class="t">&nbsp;&nbsp;发布时间(大于):</span><span class="c">
                            <zf:TextBox runat="server" class="dttxt" ID="tbEndTime2" onfocus="calendar();"></zf:TextBox></span>
                        <zf:Button runat="server" ID="Button2" Text="搜 索" OnClick="Search" class="linkbtn" />
                        <zf:Button runat="server" ID="Button1" Text="全 部" OnClick="AllList" class="linkbtn" />
                    </div>
                </td>
            </tr>
        </table>
    </div>--%>
    <!--搜索 结束-->
</asp:Content>
